import ctypes

# 加载共享库
lib = ctypes.CDLL('./LibSlowSort.dll')

# 定义函数原型
lib.bubble_sort_int.argtypes = [ctypes.POINTER(ctypes.c_int), ctypes.c_size_t]
lib.opt_bubble_sort_int.argtypes = [ctypes.POINTER(ctypes.c_int), ctypes.c_size_t]
lib.selection_sort_int.argtypes = [ctypes.POINTER(ctypes.c_int), ctypes.c_size_t]
lib.insertion_sort_int.argtypes = [ctypes.POINTER(ctypes.c_int), ctypes.c_size_t]
lib.bin_insertion_sort_int.argtypes = [ctypes.POINTER(ctypes.c_int), ctypes.c_size_t]

# 创建一个整数数组
arr = (ctypes.c_int * 10)(*range(10, 0, -1))

# 调用排序函数
lib.bubble_sort_int(arr, len(arr))

# 打印排序后的数组
print(list(arr))